﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MediaDBdotNET.AWSPAAPI;
using Simple;


namespace MediaDBdotNET
{
    public partial class Form1 : Form
    {
        private const string accessKeyId = "AKIAIUVTDD5FBELQ7T5Q";
        private const string secretKey = "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";

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            AWSECommerceServicePortTypeClient s = new AWSECommerceServicePortTypeClient("AWSECommerceServicePortDE");
            s.ChannelFactory.Endpoint.Behaviors.Add(new AmazonSigningEndpointBehavior(accessKeyId, secretKey));

            ItemLookup i = new ItemLookup();
            ItemLookupRequest r = new ItemLookupRequest();
            i.AssociateTag = "1234";
            
            r.IdType = ItemLookupRequestIdType.ASIN;
            r.ItemId = new string[] { "B001IBI0J8" };
            ////r.ResponseGroup = new string[] {"small"};
            i.Request = new ItemLookupRequest[] { r };

            ItemLookupResponse response = s.ItemLookup(i);
            textBox1.Text = response.Items[0].Item[0].ItemAttributes.Title;

        }



    }
}
